<html>
<head><meta charset="utf-8"><title>representation of type parameters · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/representation.20of.20type.20parameters.html">representation of type parameters</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="231030703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/representation%20of%20type%20parameters/near/231030703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/representation.20of.20type.20parameters.html#231030703">(Mar 19 2021 at 14:27)</a>:</h4>
<p>in the course of preparing the switch to Chalk's types, I'm wondering again about the representation of type parameters (inside the function). We currently need to be able to get from the <code>Ty</code> back to the actual global type parameter ID, so we're turning type parameters into placeholders in the root universe, with the global type param ID as the index. I guess the intended way of using placeholders is more to introduce a new universe at every point where new type parameters are introduced, and use local indexes? I'm wondering whether we should invest time into moving towards that, which would probably involve needing to introduce a context (which definition we're in) whenever we're displaying types...</p>



<a name="231041984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/representation%20of%20type%20parameters/near/231041984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/representation.20of.20type.20parameters.html#231041984">(Mar 19 2021 at 15:33)</a>:</h4>
<p>Hmm. Makes me wonder about <code>Param</code></p>



<a name="231042199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/representation%20of%20type%20parameters/near/231042199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/representation.20of.20type.20parameters.html#231042199">(Mar 19 2021 at 15:34)</a>:</h4>
<p>yeah, I saw some mentions of that</p>



<a name="231042507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/representation%20of%20type%20parameters/near/231042507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/representation.20of.20type.20parameters.html#231042507">(Mar 19 2021 at 15:36)</a>:</h4>
<p>For user defined Adts you also need a global id to identify the right definition. In rustc <code>Param</code> works similarly by having a global id for the generic parameter of the function.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>